package com.wangjw.tuling.netty.rpc.client;

import com.wangjw.tuling.netty.rpc.common.CalculatorService;
import com.wangjw.tuling.netty.rpc.common.ProxyFactory;
import com.wangjw.tuling.netty.rpc.util.SerializerFactory;

/**
 * Created by wangjianwen on 2018/12/11.
 */
public class RpcDemoClient {

    public static void main(String[] args) throws Exception {
        NettyClient client = new NettyClient();
        client.init("127.0.0.1", 8080, SerializerFactory.getSerializer());

        CalculatorService proxy = ProxyFactory.getProxy(CalculatorService.class, client);
        System.out.println(proxy.add(6.0, 2.0));
        client.close();
    }
}
